package com.example.product_practices.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("计费表实体")
@TableName(value = "charge_tb")
public class ChargeTb {
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    @ApiModelProperty("编号")
    private Integer id;
    @ApiModelProperty("用户id")
    private Integer rentId;
    @ApiModelProperty("群组num")
    private Integer groupNums;
    @ApiModelProperty("问卷num")
    private Integer quesNums;
    @ApiModelProperty("答卷num")
    private Integer answNums;
    @ApiModelProperty("总价格")
    private Double cost;

    public ChargeTb(ChargeTb chargeTb) {
        if (Objects.nonNull(chargeTb)) {
            this.id = chargeTb.id;
            this.rentId = chargeTb.rentId;
            this.groupNums = chargeTb.groupNums;
            this.quesNums = chargeTb.quesNums;
            this.answNums = chargeTb.answNums;
            this.cost = chargeTb.cost;
        }
    }
}
